import { request } from '@umijs/max';

const url = '/admin/z_dept_group';

export async function post_save_api(Req: GroupApi.Dto) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/saveOrUpate`, {
    method: 'POST',
    data: Req,
  });
}

export async function get_list_all_api() {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_dept_group/findList`, {
    method: 'POST',
  });
}

export async function delete_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/delete?id=${ID}`, {
    method: 'GET',
  });
}

export async function delete_batch_api(IDs: (string | number)[]) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/batchDelete`, {
    method: 'POST',
    data: IDs,
  });
}
